<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;
Route::group('api',function(){

    // +----------------------------------------------------------------------
    // | 收货地址
    // +----------------------------------------------------------------------
    Route::group('address',function(){
        Route::post('detail','api/address/detail');//收货地址详情
        Route::post('list','api/address/address_list');//收货地址列表
        Route::post('default','api/address/setdefault');//设置默认收货地址
        Route::post('del','api/address/del');//删除收货地址
        Route::post('edit','api/address/edit');//添加(修改)收货地址
    });

      // +----------------------------------------------------------------------
    // | 登录注册
    // +----------------------------------------------------------------------
    Route::group('login',function(){
        Route::post('login','api/login/login');                                 //登录
        Route::post('register','api/login/register');                           //注册
        Route::post('forget','api/login/forget');                               //忘记密码
        Route::post('otherlogin','api/login/otherlogin');                       //第三方
        Route::post('perfect','api/login/perfect');                             //完善资料
        Route::post('bind','api/login/bind');                                   //换手机号
    });
    // +----------------------------------------------------------------------
    // | 购物车
    // +----------------------------------------------------------------------
    Route::group('cart',function(){
        Route::post('add','api/cart/add');//添加购物车
        Route::post('update','api/cart/update');//更新购物车数量，规格
        Route::post('remove','api/cart/remove');//删除购物车
        Route::post('select','api/cart/select');//选择要下单支付的产品
        Route::post('index','api/cart/index');//购物车列表
    });
    // +----------------------------------------------------------------------
    // | 厨房
    // +----------------------------------------------------------------------
    Route::group('goods',function(){
        Route::get('category','api/goods/category');//分类
        Route::get('banner','api/goods/banner');//轮播图，规格
        Route::get('detail','api/goods/detail');//商品详情
        Route::get('comment','api/goods/comment');//商品评论列表
        Route::get('spec','api/goods/spec');//规格列表
        Route::get('option','api/goods/option');//选定规格
        Route::get('search_goods','api/goods/search_goods');//搜索商品
        Route::get('hot_search','api/goods/hot_search');//热搜标题
    });

    // +----------------------------------------------------------------------
    // | 订单
    // +----------------------------------------------------------------------
    Route::group('order',function(){
        Route::post('placeOrder','api/order/placeOrder'); //提交订单
        Route::get('preOrder','api/order/preOrder'); //获取预订单信息
        Route::get('detail','api/order/detail');//获取订单详情
        Route::get('list','api/order/index');//订单列表
        Route::post('cancel','api/order/cancel');//取消订单
        Route::get('comment_before','api/order/commentbefore');//评论前
        Route::post('comment','api/order/comment');//评论
        Route::post('receive','api/order/receive');//确认收货
        Route::post('refund','api/order/refund');//退款
        Route::post('del','api/order/delOrder');//删除订单
    });

    // +----------------------------------------------------------------------
    // | 我的
    // +----------------------------------------------------------------------
    Route::group('personal',function(){
        Route::post('praise_list','api/personal/praise_list'); //获取赞你的列表
        Route::post('personal_center','api/personal/personal_center'); //个人中心
        Route::post('attention_list','api/personal/attention_list');//获取关注列表
        Route::post('fans_list','api/personal/fans_list');//粉丝列表
        Route::post('dynamic','api/personal/dynamic');//动态列表
        Route::post('dynamic_info','api/personal/dynamic_info');//动态详情
        Route::post('suggestion','api/personal/suggestion');//意见反馈
        Route::post('system_letter','api/personal/system_letter');//系统消息
        Route::post('system_info','api/personal/system_info');//系统消息详情
        Route::post('coupon_list','api/personal/coupon_list');//我的优惠卷
        Route::post('system_coupon','api/personal/system_coupon');//系统生成优惠卷
        Route::post('get_coupon','api/personal/get_coupon');//领取优惠卷
        Route::post('send_letter','api/personal/send_letter');//发送私信
        Route::post('letter_list','api/personal/letter_list');//私信列表
        Route::post('letter_info','api/personal/letter_info');//私信详情
        Route::post('changeInformation','api/personal/changeInformation');//修改资料
        Route::post('userInfomation','api/personal/userInfomation');//查询资料
        Route::post('bind','api/personal/bind');//绑定第三方
    });

    // +----------------------------------------------------------------------
    // | 支付
    // +----------------------------------------------------------------------
    Route::group('pay',function(){
        Route::group('wechat',function(){
            Route::post('','api/pay/WxAppPay');//微信支付
            Route::post('notice','api/pay/WxPayNotice');//微信回调
        });
        Route::group('alipay',function(){
            Route::post('','api/pay/AliPay');//支付宝支付
            Route::post('notice','api/pay/AliPayNotice');//支付宝回调
        });
    });

    // +----------------------------------------------------------------------
    // | 美食圈
    // +----------------------------------------------------------------------
    Route::group('circle',function(){
        Route::post('circle_list','api/circle/circle_list'); //美食圈
        Route::post('add_circle','api/circle/add_circle'); //添加美食圈
        Route::post('forward_circle','api/circle/forward_circle');//转发美食圈
        Route::post('forward_circle_info','api/circle/forward_circle_info');//转发美食圈详情
        Route::post('circle_like','api/circle/circle_like');//美食圈点赞
        Route::post('circle_del','api/circle/circle_del');//删除美食圈
        Route::post('circle_follow','api/circle/circle_follow');//美食圈关注人
        Route::post('circle_shield','api/circle/circle_shield');//美食圈屏蔽
        Route::post('comment','api/circle/comment');//评论
        Route::post('comment_list','api/circle/comment_list');//评论
        Route::post('comment_info','api/circle/comment_info');//评论详情
        Route::post('comment_like','api/circle/comment_like');//评论点赞
        Route::post('foods_info','api/circle/foodInfo');//菜品识别
        Route::post('create_image','api/circle/createImage');//生成美食图
    });


    // +----------------------------------------------------------------------
    // | 知食
    // +----------------------------------------------------------------------
    Route::group('foods_knowledge',function(){
        Route::get('','api/KnowFoods/index');//知食列表
        Route::get('banner','api/KnowFoods/banner');//知食轮播图
        Route::get('detail','api/KnowFoods/detail');//知食详情
        Route::group('comment',function(){
            Route::post('','api/KnowFoods/comment');//知食评论
            Route::post('list','api/KnowFoods/commentList');//知食评论列表
            Route::post('detail','api/KnowFoods/commentDetail');//知食评论详情
            Route::post('thumb','api/KnowFoods/commentThumb');//知食评论点赞
        });
        Route::post('collect','api/KnowFoods/collect');//知食收藏
        Route::post('mycollect','api/KnowFoods/myCollect');//我的知食收藏
        Route::post('thumb','api/KnowFoods/thumb');//知食点赞
        Route::post('','api/KnowFoods/thumb');//知食点赞
    });

    // +----------------------------------------------------------------------
    // | 聊天
    // +----------------------------------------------------------------------
    Route::group('chat',function(){
        Route::post('list','api/Chat/chatList');//获取聊天列表
        Route::post('read','api/Chat/readChat');//阅读信息
        Route::post('customer_service','api/Chat/customer_service');//客服列表
    });


});
